$OpenBSD: patch-src_cmd_unit_generic_cpp,v 1.2 2017/06/01 11:29:12 espie Exp $
Index: src/cmd/unit_generic.cpp
--- src/cmd/unit_generic.cpp.orig
+++ src/cmd/unit_generic.cpp
@@ -47,6 +47,7 @@
 
 #include "unit_find.h"
 #include "pilot.h"
+#include <cmath>
 
 #include "vsfilesystem.h"
 #include <iostream>
@@ -630,14 +631,6 @@ void Unit::DeactivateJumpDrive()
         jump.drive = -1;
 }
 
-float copysign( float x, float y )
-{
-    if (y > 0)
-        return x;
-    else
-        return -x;
-}
-
 float rand01()
 {
     return (float) rand()/(float) RAND_MAX;
@@ -3303,7 +3296,7 @@ Vector Unit::ClampTorque( const Vector &amt1 )
     //HACK this forces the reaction to be Li-6+D fusion with efficiency governed by the getFuelUsage function
     fuel -= GetFuelUsage( false )*SIMULATION_ATOM*Res.Magnitude()*FMEC_exit_vel_inverse/Lithium6constant;
 #ifndef __APPLE__
-    if ( ISNAN( fuel ) ) {
+    if ( std::isnan( fuel ) ) {
         fprintf( stderr, "FUEL is NAN\n" );
         fuel = 0;
     }
@@ -3468,7 +3461,7 @@ Vector Unit::ClampThrust( const Vector &amt1, bool aft
                && finegrainedFuelEfficiency) ? afterburnenergy : GetFuelUsage( afterburn ) )*SIMULATION_ATOM*Res.Magnitude()
             *FMEC_exit_vel_inverse/Lithium6constant;
 #ifndef __APPLE__
-        if ( ISNAN( fuel ) ) {
+        if ( std::isnan( fuel ) ) {
             fprintf( stderr, "Fuel is NAN A\n" );
             fuel = 0;
         }
@@ -3479,7 +3472,7 @@ Vector Unit::ClampThrust( const Vector &amt1, bool aft
         //HACK this forces the reaction to be Li-6+Li-6 fusion with efficiency governed by the getFuelUsage function
         fuel -= GetFuelUsage( false )*SIMULATION_ATOM*Res.Magnitude()*FMEC_exit_vel_inverse/Lithium6constant;
 #ifndef __APPLE__
-        if ( ISNAN( fuel ) ) {
+        if ( std::isnan( fuel ) ) {
             fprintf( stderr, "Fuel is NAN B\n" );
             fuel = 0;
         }
